exports.Serial = function(taskArr,cb){

	async.waterfall(taskArr,()=> {

       return cb();
       
    });
        
}

exports.Parallel = function(taskArr,cb){

	async.parallel(taskArr,()=> {

       cb();
       
    });
        
}

//循环请求处理
exports.SerialEach = function(taskArr,fun,cb){

    //循环查询
    var tasks = [];

    taskArr.forEach((item,index) => {

        tasks.push((callback) => {

            fun(item,index,callback);

        });

    });

  
    async.waterfall(tasks,cb);
  

}

//循环请求处理
exports.ParallelEach = function(taskArr,fun,cb){

    //循环查询
    var tasks = [];

    taskArr.forEach((item,index) => {

        tasks.push((callback) => {

            fun(item,index,callback);

        });

    });

    async.parallel(tasks,()=>{
        cb();
    });
    
}
